package com.demo.listener;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

/**
 * Created by HYZ on 2018/1/27.
 */
public class DefaultResponseMessageListener implements MessageListener{

    private Logger logger = LoggerFactory.getLogger(ResponseQueueListener.class);

    @Override
    public void onMessage(Message message) {
        if (message instanceof TextMessage){
            TextMessage textMessage = (TextMessage) message;
            try {
                logger.info("接收到defaultResponseQueue的一个文本消息:{}",textMessage.getText());
            } catch (JMSException e) {
                logger.error("",e);
            }
        }
    }
}
